package cn.tedu.straw.portal.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.util.DigestUtils;

public class PasswordUtils {
    private static BCryptPasswordEncoder passwordEncoder=new BCryptPasswordEncoder();
    public static String encode(String password){
        //return DigestUtils.md5DigestAsHex(password.getBytes());
        return "{bcrypt}"+passwordEncoder.encode(password);
    }
}
